<template>
  <div class="page">
    <el-form label-width="80px" inline :model="searchFrom">
      <el-form-item label="反馈类型">
        <el-input v-model="searchFrom.name"></el-input>
      </el-form-item>
      <el-form-item label="反馈分类">
        <el-input v-model="searchFrom.region"></el-input>
      </el-form-item>
      <el-form-item label="处理状态">
        <el-input v-model="searchFrom.type"></el-input>
      </el-form-item>
      <el-form-item label="反馈时间">
        <el-input v-model="searchFrom.type"></el-input>
      </el-form-item>
      <el-form-item label="">
        <el-button type="primary">搜索</el-button>
      </el-form-item>
    </el-form>
    <el-table
      :data="tableData"
      style="width: 100%;margin-bottom: 20px;"
      row-key="id"
      border>
      <el-table-column
        prop="date"
        label="反馈类型"
        sortable
        width="180">
      </el-table-column>
      <el-table-column
        prop="name"
        label="反馈问题分类"
        sortable
        width="180">
      </el-table-column>
      <el-table-column
        prop="question"
        label="反馈意见">
      </el-table-column>
      <el-table-column
        prop="creatTime"
        label="反馈时间">
      </el-table-column>
      <el-table-column
        prop="address"
        label="反馈人">
      </el-table-column>
      <el-table-column
        prop="address"
        label="处理状态">
      </el-table-column>
      <el-table-column
        prop="address"
        label="反馈回复">
      </el-table-column>
      <el-table-column
        prop="address"
        label="回复人">
      </el-table-column>
      <el-table-column
        prop="address"
        label="回复时间">
      </el-table-column>
      <el-table-column
        label="操作">
        <template slot-scope="{row}">
          <el-button type="text" @click="show(row)">回复</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination
      @size-change="pageSizeChange"
      @current-change="pageNoChange"
      :current-page.sync="page.pageNo"
      :page-size="page.pageSize"
      layout="total, prev, pager, next"
      :total="page.total">
    </el-pagination>

    <el-dialog
      :title="form.id ? '编辑' : '新增'"
      :visible.sync="dialogVisible"
      fullscreen
      :before-close="handleClose">
      <el-form label-position="right" label-width="80px" :model="form">

        <el-form-item label="回复">
          <el-input type="textarea" v-model="form.introduction" placeholder="请输入姓名"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button :loading="loading" type="primary" @click="submit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { userFeedback } from '@/api/official/official'
export default {
  name: 'InternetHospitalMangeSmartGuide',

  data() {
    return {
      searchFrom: {},
      page:{
        total:0,
        pageSize:10,
        pageNo:1,
      },
      tableData: [{
        id: 1,
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        id: 2,
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }],
      form: {}
    };
  },

  mounted() {
    this.userFeedback()
  },

  methods: {
    userFeedback() {
      userFeedback({page: 1, size: 10}).then(res => {
        console.log(res)
        this.tableData = res
      })
    },
    show(row = {}) {
      this.dialogVisible = true
      this.form = {...row}
    }
  },
};
</script>

<style lang="scss" scoped>
.page {
  padding: 24px;
}
</style>
